package test00.lx06;

import java.util.Optional;

/**
 * @author CSY
 * @date 2025 - 04 - 07
 */
public class MainTest02 {
    public static void main(String[] args) {
        Student zs = new Student("Zs",18);
        Student ls = new Student("Csy",20);
        Student ww = new Student(null,17);
        Optional<Student> optional = Optional.of(zs);
        String userName = optional.map(Student::getName).map(String::toLowerCase).orElse("匿名");
        System.out.println(userName);
    }
}
